package _interview150;

/**
 * 26. 删除有序数组中的重复项
 */
public class No26 {
    public int removeDuplicates(int[] nums) {
        int left = 1;
        for (int right = 1; right < nums.length; right++) {
            if (nums[right] != nums[right - 1]) nums[left++] = nums[right];
        }
        return left;
    }
}
